package me.sealer.ssm.core;

/**
 * 功能描述： $ MessageSupport
 *
 * @author sealer
 * @email 1178884049@qq.com
 * @date 2019年11月28日 17时07分14秒
 */
public class MessageSupport implements Messageable {
    private String messageKey;
    private String defaultMessage;
    private Object[] args;

    public MessageSupport(String messageKey, String defaultMessage, Object[] args) {
        this.messageKey = messageKey;
        this.defaultMessage = defaultMessage;
        this.args = args;
    }

    @Override
    public String getDefaultMessage() {
        return defaultMessage;
    }

    @Override
    public boolean hasDefaultMessage() {
        return defaultMessage != null;
    }

    @Override
    public String getMessageKey() {
        return messageKey;
    }

    @Override
    public Object[] getArgs() {
        return args;
    }

    public void setMessageKey(String messageKey) {
        this.messageKey = messageKey;
    }

    public void setDefaultMessage(String defaultMessage) {
        this.defaultMessage = defaultMessage;
    }

    public void setArgs(Object[] args) {
        this.args = args;
    }
}
